#include<iostream>

using namespace std;
using ll=long long;
const ll MAXP = 100000;
ll prim[MAXP];
ll max2, numb, PCOUNT; //max存放最多约数个数，numb存放约数个数最多的数

void primes(); //用筛选法产生质数存于prim数组中
void search(ll from, ll tot, ll num, ll low, ll up);

int main() {
    primes();
    ll l, u;
    cin >> l >> u;
    if ((l == 1) && (u == 1)) {
        max2 = 1;
        numb = 1;
    } else {
        max2 = 2;
        numb = l;
        search(1, 1, 1, l, u);
    }
    cout << max2 << endl;
    return 0;
}


void primes() //执行完后: prim[]={2, 3, 5, 7, 11, 13……}
{
    bool get[MAXP + 1];
    ll i;
    for (i = 2; i <= MAXP; i++)
        get[i] = true;

    for (i = 2; i <= MAXP; i++)
        if (get[i]) {
            ll j = i + i;
            while (j <= MAXP) {
                get[j] = false;
                j += i;
            }
        }
    ll ii, j;
    for (ii = 2, j = 0; ii <= MAXP; ii++)
        if (get[ii]) prim[++j] = ii;
    PCOUNT = j;
}

// 区间[low,up]上，tot为当前约数最多个数，num为约数个数最多的数，
//from表示现在是第几个质数。
void search(ll from, ll tot, ll num, ll low, ll up) {
    if (num >= 1)
        if ((tot > max2) || ((tot == max2) && (num < numb))) {
            max2 = tot;
            numb = num;
        }

    if ((low == up) && (low > num)) search(from, tot * 2, num * low, 1, 1);

    for (ll i = from; i <= PCOUNT; i++) {
        if (prim[i] > up) return;
        else {
            ll j = prim[i], x = low - 1, y = up, n = num, t = tot, m = 1;
            while (true) {
                m++;
                t += tot;
                x /= j;
                y /= j;
                if (x == y) break;
                n *= j;
                search(i + 1, t, n, x + 1, y);
            }
            m = 1 << m;
            if (tot < max2 / m) return;
        }//end else
    }//end for
}